Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
👀 AI Code ReviewSomething went wrong: <urlopen error [Errno -2] Name or service not known> Powered by GPT-4o via GitHub Models |
|
It should be configured by bash guard plugin config (not in opencode's config). For commands, which matches items in config, should be processed this way. Old behavior with opencode permissions block based checks should continue working too. |
|
The config format should be different. For example: Less permission level should win. |
Do not forget about multi args cases and potential neested permissions declaration |
Summary
OpenSpec change proposal for
flag-level-permissions— adds granular, flag-aware command permission control. No implementation yet; this PR is the reviewed proposal (proposal → design → spec → tasks). Implementation follows via/opsx-apply.Why
permission.bashglobs match the whole command string, so flag-level intent can't be expressed reliably:"curl *": "ask"always catchescurl -X GET https://api.comeven if a narrower allow rule exists. Dangerous flags (find ... -delete,git push --force) deserve their own actions.Proposed config
{ "permission": { "bash": { "*": "ask", "git *": "allow" }, "bash_args": [ { "pattern": "curl -X GET *", "action": "allow" }, { "pattern": "curl *", "action": "ask" }, { "pattern": "find * -delete", "action": "ask" }, { "pattern": "git push --force *", "action": "deny" } ] } }Key design decisions
*matches zero+ whitespace tokens (find * -deletematchesfind /tmp -name "*.log" -delete, not plainfind /tmp)permission.bashglob matching when no args rule matchesallowoverrides a native opencodeaskviapermission.ask(status = "allow"), without this thecurl -X GET * → allowuse case wouldn't work end-to-endpermission.bash_argsis absentArtifacts
openspec/changes/flag-level-permissions/proposal.md— what & whyopenspec/changes/flag-level-permissions/design.md— 7 decisions + risksopenspec/changes/flag-level-permissions/specs/args-permission-matching/spec.md— 5 requirements, 24 scenariosopenspec/changes/flag-level-permissions/tasks.md— 6 sections, 30 tasksNext steps
/opsx-applyto implement (tasks 1–6)Ultraworked with Sisyphus